-- Renderer
-- 辅助渲染函数库

Renderer = {}

-- 画文本(3D)
-- 参数:x,y,z(坐标),xRot,yRot,zRot(3个轴的旋转角度),文本,大小,颜色(可选)
function Renderer.drawText3D(x,y,z,xRot,yRot,zRot,Text,size,color)
    pushMatrix()
    pushStyle()
    
    translate(x,y,z)
    rotate(xRot,1,0,0)
    rotate(yRot,0,1,0)
    rotate(zRot,0,0,1)
    scale(0.02,0.02,0.02)
    fontSize(size * 50)
    if color then
        fill(color)
    end
    text(Text,0,0)

    popStyle()
    popMatrix()
end
